package edu.sctu.zhoudie.mouth201506.day20150607;

/**
 * Created by Administrator on 2015-06-07.
 */

public class ThreadUtil {
    private int time;
    public ThreadUtil(int time){
        this.time = time;
    }
    public void startThread(){
        new Thread(){
            @Override
        public void run(){
                super.run();
                for (int i = 0; i <time ; i++) {
                    System.out.println(i);
                    try {
                        Thread.sleep(1000);
                    }catch (InterruptedException e){
                        e.printStackTrace();
                    }
                }
                time++;
                System.out.println(time);
            }
        }.start();
    }
}


